package jmine.tec.web.wicket.mock;

import jmine.tec.web.wicket.component.menu.MenuInternalLink;
import jmine.tec.web.wicket.component.menu.MenuItem;
import jmine.tec.web.wicket.component.menu.MenuJSFLink;
import jmine.tec.web.wicket.component.menu.MenuPanel;
import jmine.tec.web.wicket.component.menu.MenuPrincipal;
import jmine.tec.web.wicket.component.menu.WicketMenuPanel;
import jmine.tec.web.wicket.pages.Paging;
import jmine.tec.web.wicket.pages.Report;
import jmine.tec.web.wicket.pages.example.crud.CrudPageExample;
import jmine.tec.web.wicket.pages.example.execute.ExecutePageExample;
import jmine.tec.web.wicket.pages.example.executeajaxselection.ExecutePageAjaxExample;
import jmine.tec.web.wicket.pages.example.list.ListPageExample;
import jmine.tec.web.wicket.pages.example.report.ReportPageExample;

/**
 * Menu principal da aplicação de teste
 * 
 * @author Rafael Volpato
 * @date Oct 4, 2011
 */
public class MockMenuPrincipal implements MenuPrincipal {

    /**
     * {@inheritDoc}
     */
    public MenuPanel getMenuPanel(String id) {
        WicketMenuPanel menu = new WicketMenuPanel(id);

        MenuItem menuPrincipal = new MenuItem("Principal");
        menu.addMenu(menuPrincipal);

        menuPrincipal.addLink(new MenuInternalLink("Report", Report.class));
        menuPrincipal.addLink(new MenuInternalLink("Paging", Paging.class));

        MenuItem searchMenu = new MenuItem("Search");
        menu.addMenu(searchMenu);

        searchMenu.addLink(new MenuJSFLink("Sample JSF", "/protected/example.faces"));

        MenuItem exampleMenu = new MenuItem("Example");
        menu.addMenu(exampleMenu);

        exampleMenu.addLink(new MenuInternalLink("List Page", ListPageExample.class));
        exampleMenu.addLink(new MenuInternalLink("CRUD Page", CrudPageExample.class));
        exampleMenu.addLink(new MenuInternalLink("Execute Page", ExecutePageExample.class));
        exampleMenu.addLink(new MenuInternalLink("Execute Page (Ajax)", ExecutePageAjaxExample.class));
        exampleMenu.addLink(new MenuInternalLink("Report Page", ReportPageExample.class));
        menu.build();
        return menu;
    }

}
